package com.Homework2;

import java.sql.SQLOutput;
import java.util.*;

public class Test01 {
    public static void main(String[] args) {
        HashMap<Object, Object> map = new HashMap<>();
        HashSet<Object> hashSet = new HashSet<>();
        int num=1;
        while (hashSet.size()<5){
            hashSet.add(map);
            System.out.println("使用键盘录入第"+num+++"个学生信息,录入格式为:”姓名,年龄”");
            String input = new Scanner(System.in).nextLine();
            String[] split = input.split(",");
            map.put(split[0],split[1]);
            while (hashSet.size()==5){
                System.out.println("录入完毕");
                break;
            }
        }
        Set<Map.Entry<Object, Object>> entries = map.entrySet();
        for (Map.Entry<Object, Object> entry : entries) {
            System.out.println(entry.getKey()+"->"+entry.getValue());
        }
    }
}
